<template>
  <div class="dashboard">
    <div class="dashboard-header">
      <h1>npm-explore 仪表盘</h1>
      <p>探索和管理npm包的一站式平台</p>
    </div>
    
    <div class="dashboard-cards">
      <el-card class="dashboard-card" @click="$router.push('/packages')">
        <div class="card-icon">📦</div>
        <h3>包管理</h3>
        <p>浏览和管理npm包</p>
      </el-card>
      
      <el-card class="dashboard-card" @click="$router.push('/tags')">
        <div class="card-icon">🏷️</div>
        <h3>标签管理</h3>
        <p>管理和浏览包标签</p>
      </el-card>
      
      <el-card class="dashboard-card" @click="$router.push('/stats')">
        <div class="card-icon">📊</div>
        <h3>统计信息</h3>
        <p>查看包下载统计</p>
      </el-card>
      
      <el-card class="dashboard-card" @click="$router.push('/discussions')">
        <div class="card-icon">💬</div>
        <h3>讨论区</h3>
        <p>参与包相关讨论</p>
      </el-card>
      
      <el-card class="dashboard-card" @click="$router.push('/sync')">
        <div class="card-icon">🔄</div>
        <h3>数据同步</h3>
        <p>同步npm registry数据</p>
      </el-card>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Dashboard',
  layout: 'default',
  async fetch() {
    // 可以在这里加载初始数据
  }
}
</script>

<style scoped>
.dashboard {
  padding: 24px;
}

.dashboard-header {
  margin-bottom: 32px;
  text-align: center;
}

.dashboard-header h1 {
  font-size: 32px;
  margin-bottom: 8px;
  color: #262626;
}

.dashboard-header p {
  font-size: 16px;
  color: #8c8c8c;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.dashboard-card {
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.dashboard-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.dashboard-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: #262626;
}

.dashboard-card p {
  font-size: 14px;
  color: #8c8c8c;
}
</style>